package com.design.design.pattern.singleton;

public class Apple {
    private Apple() {

    }
    private String origin;
    private Integer price;

    public String getOrigin() {
        return origin;
    }

    public void setOrigin(String origin) {
        this.origin = origin;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    private enum AppleSingleton {

       INSTANCE;

       private final Apple instance;

       AppleSingleton() {
           instance = new Apple();
       }
       private Apple getInstnce() {
           return instance;
       }
   }
   public static Apple getInstance() {
        return AppleSingleton.INSTANCE.getInstnce();
   }
}
